/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package actions;

import com.paris5.master2.guitarmaster.bean.EcomCartRow;
import com.paris5.master2.guitarmaster.service.ServiceCartRemoteE;
import java.util.List;

/**
 *
 * @author Leticia
 */
public class Commande extends EcomAction {
    private List<EcomCartRow> liste;
    private float totalPrice;
            
    @Override
    public String execute() {    
        ServiceCartRemoteE serviceCartRemoteE = (ServiceCartRemoteE) getFromSession("PANIER");
        if (serviceCartRemoteE == null) {
            setMessage("Panier vide.");
            return INPUT;
        }
        liste = (List<EcomCartRow>) serviceCartRemoteE.getCart();

        totalPrice = serviceCartRemoteE.getTotalPrice();
        registerRate();
        return SUCCESS;
    }

    public List<EcomCartRow> getListe() {
        return liste;
    }

    public void setListe(List<EcomCartRow> liste) {
        this.liste = liste;
    }     

    public float getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(float totalPrice) {
        this.totalPrice = totalPrice;
    }   
    
}
